core: Support being built without libsoup-gnome
authorColin Walters <walters@verbum.org>
Mon, 14 Nov 2011 20:08:09 +0000 (15:08 -0500)
committerColin Walters <walters@verbum.org>
Mon, 14 Nov 2011 20:08:09 +0000 (15:08 -0500)
While bootstrapping gnomeos, it's really handy if we can be built
without pull support, because libsoup-gnome pulls in a huge set of
dependencies.

Makefile-ostree.am
configure.ac
ostree/main.c

index dfc09a052199d45f793ecde5e48a4c950cd4a5e1..b39f9bd86307fd687f722963e4b954a0c623140d 100644 (file)
@@ -28,11 +28,14 @@ ostree_SOURCES = ostree/main.c \
        ostree/ot-builtin-fsck.c \
        ostree/ot-builtin-init.c \
        ostree/ot-builtin-log.c \
-       ostree/ot-builtin-pull.c \
        ostree/ot-builtin-run-triggers.c \
        ostree/ot-builtin-remote.c \
        ostree/ot-builtin-rev-parse.c \
        ostree/ot-builtin-show.c \
        $(NULL)
+
+if USE_LIBSOUP_GNOME
+ostree_SOURCES += ostree/ot-builtin-pull.c
+endif
 ostree_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libotutil -I$(srcdir)/libostree -I$(srcdir)/ostree  -DLOCALEDIR=\"$(datadir)/locale\" $(OT_COREBIN_DEP_CFLAGS)
 ostree_LDADD = libotutil.la libostree.la $(OT_COREBIN_DEP_LIBS)
index 71a9e70e3bcf74ebc78aefa93d4df2460b3958cc..a72004b13acabc23af049ff0204826091417515e 100644 (file)
@@ -25,8 +25,26 @@ LT_INIT
 
 PKG_PROG_PKG_CONFIG
 
+GIO_DEPENDENCY="gio-unix-2.0 >= 2.28"
 PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0 >= 2.28])
-PKG_CHECK_MODULES(OT_COREBIN_DEP, [libsoup-gnome-2.4 >= 2.34.0 gio-unix-2.0 >= 2.28])
+AC_ARG_WITH(soup-gnome,
+           AS_HELP_STRING([--without-soup-gnome], [Do not use libsoup-gnome (implies no pull support)]),
+           :, with_soup_gnome=maybe)
+if test x$with_soup_gnome != xno; then
+    PKG_CHECK_MODULES(OT_COREBIN_DEP, [libsoup-gnome-2.4 >= 2.34.0 $GIO_DEPENDENCY], have_soup_gnome=yes, have_soup_gnome=no)
+    if test x$have_soup_gnome = xno && test x$with_soup_gnome != xmaybe; then
+       AC_MSG_ERROR([libsoup-gnome is enabled but could not be found])
+    fi
+    if test x$have_soup_gnome = xyes; then
+        AC_DEFINE([HAVE_LIBSOUP_GNOME], [1], [Define if we have libsoup-gnome])
+    else
+       PKG_CHECK_MODULES(OT_COREBIN_DEP, [$GIO_DEPENDENCY])
+    fi         
+else
+    PKG_CHECK_MODULES(OT_COREBIN_DEP, [$GIO_DEPENDENCY])
+fi
+
+AM_CONDITIONAL(USE_LIBSOUP_GNOME, test $with_soup_gnome != no)
 
 AM_PATH_PYTHON
 
index ef67c988b804ff6e924210bf955bd5220a753321..cf0e89c16a6b390ff4c6d8e810996d8abe6f4fb7 100644 (file)
@@ -35,7 +35,9 @@ static OstreeBuiltin builtins[] = {
   { "commit", ostree_builtin_commit, 0 },
   { "compose", ostree_builtin_compose, 0 },
   { "log", ostree_builtin_log, 0 },
+#ifdef HAVE_LIBSOUP_GNOME
   { "pull", ostree_builtin_pull, 0 },
+#endif
   { "fsck", ostree_builtin_fsck, 0 },
   { "remote", ostree_builtin_remote, 0 },
   { "rev-parse", ostree_builtin_rev_parse, 0 },